//
//  ViewController.m
//  SoundRecorder
//
//  Created by zk on 14-10-23.
//  Copyright (c) 2014年 nitt. All rights reserved.
//

#import "ViewController.h"
#import "PlayViewController.h"

@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,strong) NSArray *list;

@property (nonatomic,strong) NSIndexPath *indexPath;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	self.list = @[@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11"];
    self.title = @"资源库";
}

//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//{
//    return 11;
//}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.list.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    
    cell.textLabel.text = self.list[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    PlayViewController *play = [[PlayViewController alloc]init];
    
    self.indexPath = indexPath;
    
    [self.navigationController pushViewController:play animated:YES];
}
@end
